Public Partial Class wucDataScript
    Inherits System.Web.UI.UserControl

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim strScript As String
        strScript = ""
        strScript += ""
        strScript += "function Mascara(o,f){"
        strScript += "  v_obj = o;"
        strScript += "  v_fun = f;"
        strScript += "  setTimeout('execmascara()',1);"
        strScript += "}"
        strScript += "function execmascara(){"
        strScript += "  v_obj.value = v_fun(v_obj.value);"
        strScript += "}"
        strScript += "function Data(v){"
        strScript += "  v=v.replace(/\D/g,''); "
        strScript += "  v=v.replace(/(\d{2})(\d)/,'$1/$2'); "
        strScript += "  v=v.replace(/(\d{2})(\d)/,'$1/$2'); "
        strScript += "  return v;"
        strScript += "}"
        Me.Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "Script", strScript, True)
        Me.txtData.Attributes.Add("OnKeyUP", "Mascara(this, Data)")

    End Sub

    Public Property Data() As String
        Get
            Return Trim(txtData.Text)
        End Get
        Set(ByVal value As String)
            txtData.Text = value
        End Set
    End Property


    Public WriteOnly Property ToolTip() As String
        Set(ByVal value As String)
            Me.txtData.ToolTip = value
        End Set
    End Property

End Class